<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>退赔记录</title>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/plugins/jQuery/themes/default/easyui.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/plugins/jQuery/themes/icon.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/plugins/jQuery/demo.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/admin/css/form.css"/>
	
	<script src="${pageContext.request.contextPath }/plugins/jQuery/jquery.min.js"></script>
	<script src="${pageContext.request.contextPath }/plugins/jQuery/jquery.easyui.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/jQuery/easyui-lang-zh_CN.js"></script>
	
	<script type="text/javascript">
	
	   $(function(){
	   
	        $('#station').combobox({
				valueField:'station_id', //值字段
				textField:'station_name', //显示的字段
				url:'${pageContext.request.contextPath }/admin/station/findStationByKind/1',
				onLoadSuccess : function(data) {
		            $('#station').combobox("setValue",-1);
	        	}
	        });

			loadTable();
			
	    });
		
		function loadTable(){
			$('#dg').datagrid({
				rownumbers:true,
				singleSelect:true,
				pagination:true,
				pageSize:20,
				pageList:[10,20,30,50,100],
		 		url:'${pageContext.request.contextPath }/admin/return/returnrecord',
		 		queryParams:{
		 			 startDate:$("#start_time").textbox('getValue'),
		 			 endDate:$("#end_time").textbox('getValue'),
		 			 stationid:$("#station").combobox('getValue'),
		 			 custname:$("#cust_name").val()
		 		},
	    		columns:[[
	    		    {field:'apply_time',title:'退赔操作时间',align:'center',width:140},
	    		    {field:'order_date',title:'退赔订单时间',align:'center',width:110},
	    		    {field:'station_name',title:'服务站',align:'center',width:120},    		    
	    		    {field:'kind',title:'退赔类型',align:'center',width:170},
	    		    {field:'cust_name',title:'客户姓名',align:'center',width:80},
	    		    {field:'mobile',title:'手机号',align:'center',width:100},
	    		    {field:'amount',title:'退赔金额',align:'center',width:80},
	    		    {field:'num',title:'退赔件数',align:'center',width:70},
	    		    {field:'username',title:'操作人',align:'center',width:80},
	    		    {field:'operator',title:'操作',align:'center',width:110,formatter: function (value, row, index) {			
						var str=' <a href="javascript:returnrecord(\''+row.sn+'\')" name="return_record"  class="easyui-linkbutton" ></a>';
						return str;
					}}
					
	 			]],
				onLoadSuccess:function(data){  
			        $("a[name='return_record']").linkbutton({text:'详细信息',plain:true,iconCls:'icon-search'});
				}
			});
		}
		
		function findData(){
			loadTable();
		}
		
		function toExcel(){
			$('#ff').submit();
//			Export('导出excel', $('#dg'));
		}
		
		function returnrecord(sn){
			parent.window.addTab("退赔记录详情","${pageContext.request.contextPath }/admin/return/returndetails/"+sn,"icon-search");
//			location.href="${pageContext.request.contextPath }/admin/return/returndetails/"+sn;
		}
		
	</script>
	<style type="text/css">
		body{
		font-family:'微软雅黑';}
	</style>
  </head>
  
  <body>
	<table id="dg" toolbar="#searchtool" loadMsg="正在查询..." style="width:1100px;height:auto;"></table>
	
	<div id="searchtool" style="padding:5px; height:auto;">
		<form action="${pageContext.request.contextPath}/admin/return/exportReturnBillList" method="post" id="ff">    
	       <span style="margin:0px 12px;">开始时间:</span><input id="start_time" class="easyui-datebox" name="startDate" style="width:120px" value="${currDate }">  
	       <span style="margin:0px 12px;">结束时间：</span><input id="end_time" class="easyui-datebox" name="endDate" style="width:120px" value="${currDate }">
	       <span style="margin:0px 12px;">服务站:</span><input id="station" class="easyui-textbox" name="stationid" style="width:160px;height:26px"/> 
	       <span style="margin:0px 12px;">客户姓名:</span><input id="cust_name" class="easyui-textbox" name="custname" style="width:100px;height:26px"/> 
	       <a href="javascript:findData()" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width:100px;margin:0px 3px;">查询</a>
	       <a href="javascript:toExcel()" class="easyui-linkbutton" data-options="iconCls:'icon-my-save'" style="width:100px;margin:0px 3px;">导出Excel</a>
	    </form>
    </div>
  </body>
</html>
